<template>
  <transition name="fadeOacity">
    <div class="articlDetail flex grow column" v-show="visible">
      <span slot="close" class="icon-close" @click="close"></span>
      <div class="line flex shrink column">
        <div class="flex grow">
          <div class="blok1 flex grow">
            <span class="square square1"></span>
          </div>

          <img
            :src="PIC_URL + '/tlbypcWeb/pulicImg/tanchuang_bg.png'"
            width="222"
            alt=""
          />

          <div class="blok2 flex grow">
            <span class="square square2"></span>
          </div>
        </div>
      </div>
      <div class="wrap grow column" ref="content">
        <slot></slot>
      </div>
      <span class="square square3"></span>
      <span class="square square4"></span>
    </div>
  </transition>
</template>

<script>
export default {
  props: ["visible"],
  data() {
    return {};
  },
  watch: {
    visible() {
      this.scrollToUp();
    },
  },
  computed: {},
  methods: {
    scrollToUp() {
      this.$refs.content.scrollTop = 0;
    },
    close() {
      this.$emit("update:visible", false);
    },
  },
};
</script>
<style lang="scss">
.articlDetail {
  position: relative;
  max-width: 948px;
  height: 948px;
  max-height: 70%;
  min-width: 548px;
  min-height: 400px;
  .icon-close {
    position: absolute;
    right: -53px;
    top: -42px;
    width: 40px;
    height: 40px;
    display: inline-block;

    background: url($PIC_URL + "/tlbypcWeb/qianfu/x.png") no-repeat center;
    cursor: pointer;
    z-index: 500;
  }
  .square {
    display: inline-block;
    position: absolute;
    width: 13px;
    height: 13px;
    &.square1 {
      background: url($PIC_URL + "/tlbypcWeb/qianfu/4_1.png") no-repeat left top;
      left: 0;
      top: 0;
    }
    &.square2 {
      background: url($PIC_URL + "/tlbypcWeb/qianfu/4_2.png") no-repeat right
        top;
      right: 0;
      top: 0;
    }
    &.square3 {
      background: url($PIC_URL + "/tlbypcWeb/qianfu/4_3.png") no-repeat left
        bottom;
      left: 0;
      bottom: 0;
    }
    &.square4 {
      background: url($PIC_URL + "/tlbypcWeb/qianfu/4_4.png") no-repeat right
        bottom;
      right: 0;
      bottom: 0;
    }
  }
  .line {
    .blok1 {
      border-left: 1px solid #1050ae;
      border-top: 1px solid #1050ae;
      background: #061231;
      position: relative;
      box-shadow: inset 0 0, inset 26px 26px 12px -20px rgba(48, 74, 142, 0.67),
        inset 0 0, inset 0 0;
    }
    .blok2 {
      border-right: 1px solid #1050ae;
      border-top: 1px solid #1050ae;
      background: #061231;
      position: relative;
      box-shadow: inset 0 0, inset -26px 26px 12px -20px rgba(48, 74, 142, 0.67),
        inset 0 0, inset 0 0;
    }
  }
  .wrap {
    padding: 24px 26px 20px;
    overflow-y: auto;
    border: 1px solid #1050ae;
    border-top: 0;
    position: relative;
    background: #061231;
    box-shadow: inset 0 0, inset 25px -14px 12px -20px rgba(48, 74, 142, 0.67),
      inset -25px -14px 12px -20px rgba(48, 74, 142, 0.67),
      inset 0 -25px 12px -20px rgba(48, 74, 142, 0.67);
    .title {
      color: #45c8ff;
      font-size: 20px;
      text-align: center;
      font-weight: 400;
      word-break: break-all;
    }
    .time {
      color: #45c8ff;
      font-size: 14px;
      font-weight: 400;
      text-align: center;
      margin: 13px 0 16px;
    }
    .txt {
      border-top: 1px solid #11264a;
      padding-top: 15px;
      font-size: 18px;
      color: #3bacdb;
      line-height: 28px;
      text-align: justify;
      word-break: break-all;
    }
  }
}
.fadeOacity-enter-active {
  opacity: 1;
  transition: all 0.5s;
  transform: scale(1, 1);
}
.fadeOacity-enter {
  opacity: 0;
  transform: scale(0.1, 0.1);
}
</style>
